package o;

import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView.a;
import androidx.recyclerview.widget.RecyclerView.s;
import com.huawei.appgallery.assistantdock.base.cardkit.bean.BuoyBaseCardBean;
import com.huawei.appgallery.assistantdock.gamemode.card.BuoyBaseEnterCard;
import java.util.ArrayList;
import java.util.List;

public class bin extends a {
    private List ʻ = new ArrayList();
    private bij ˊ;
    private boolean ˋ = false;
    private List ˎ;
    private List ˏ = new ArrayList();
    private boolean ॱ = false;

    public static class e extends s {
        private View ʻॱ;
        private ImageView ᐝॱ;

        public e(View view) {
            super(view);
            this.ʻॱ = view;
            this.ᐝॱ = (ImageView) view.findViewById(beo$e.ˏˎ);
        }

        public void ˎ(Object obj, boolean z, boolean z2, boolean z3) {
            BuoyBaseEnterCard ˊ = new bid(this.ʻॱ.getContext()).ˊ(obj, true, false, "ALLSERVICE");
            if (ˊ != null) {
                this.ᐝॱ.setAlpha(1.0f);
                if (!z2 || z) {
                    this.ᐝॱ.setVisibility(8);
                } else {
                    this.ᐝॱ.setVisibility(0);
                    if (z3) {
                        this.ᐝॱ.setAlpha(0.3f);
                    }
                }
                ˊ.ˏ(z3);
                ˊ.ˎ(z2);
                ˊ.ˏ(this.ʻॱ);
                ˊ.ˏ(new BuoyBaseCardBean());
            }
        }
    }

    public void ॱ(boolean z) {
        this.ˋ = z;
    }

    public bin(bij o_bij) {
        this.ˊ = o_bij;
    }

    public void ˊ(List list) {
        this.ʻ = list;
    }

    @NonNull
    public s ˎ(@NonNull ViewGroup viewGroup, final int i) {
        View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(beo$j.ʻ, viewGroup, false);
        LayoutParams layoutParams = inflate.getLayoutParams();
        layoutParams.width = -1;
        inflate.setLayoutParams(layoutParams);
        inflate.findViewById(beo$e.ˏˎ).setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ bin ॱ;

            public void onClick(View view) {
                if (!this.ॱ.ॱ) {
                    Object ˏ = this.ॱ.ᐝ(i);
                    if (this.ॱ.ˊ != null) {
                        this.ॱ.ˊ.ˊ(ˏ);
                        this.ॱ.ˏ.remove(ˏ);
                        this.ॱ.ˊ();
                    }
                }
            }
        });
        return new e(inflate);
    }

    public int ˎ(int i) {
        return i;
    }

    private Object ᐝ(int i) {
        if (CollectCheck.isEmpty(this.ˏ) || i < 0 || i >= this.ˏ.size()) {
            return "";
        }
        return this.ˏ.get(i);
    }

    public void ॱ(@NonNull s sVar, int i) {
        if (sVar instanceof e) {
            sVar.ॱ(false);
            e eVar = (e) sVar;
            Object ᐝ = ᐝ(i);
            eVar.ˎ(ᐝ, ˊ(ᐝ), this.ˋ, this.ॱ);
        }
    }

    private boolean ˊ(Object obj) {
        if (CollectCheck.isEmpty(this.ʻ)) {
            return false;
        }
        return this.ʻ.contains(obj);
    }

    public int ˏ() {
        if (CollectCheck.isEmpty(this.ˏ)) {
            return 0;
        }
        return this.ˏ.size();
    }

    public void ॱ(List list) {
        this.ˎ = list;
    }

    public void ॱ() {
        this.ˏ.clear();
        if (this.ˎ != null) {
            this.ˏ.addAll(this.ˎ);
            this.ˏ.removeAll(this.ʻ);
        }
        if (this.ʻ.size() >= 8) {
            ˎ(true);
        } else {
            ˎ(false);
        }
        ˊ();
    }

    public boolean ᐝ() {
        return this.ˏ == null || this.ˏ.size() == 0;
    }

    public void ˎ(boolean z) {
        this.ॱ = z;
    }
}
